﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace MazeGenerator
{
  class Program
  {
    static void Main(string[] args)
    {
      Bitmap map = (Bitmap)Image.FromFile(@"C:\Users\Chris\Pictures\rally-x-clean.bmp");
      StringBuilder sb = new StringBuilder();
      Color wall = Color.FromArgb(255, 85, 194, 0);
      Color road = Color.FromArgb(255, 226, 165, 85);
      string value;
      for (int y = 4; y < 60; y++)
      {
        sb.Append("new int[] {1, 1, 1, ");
        for (int x = 5; x < 37; x++)
        {
          Color pixel = map.GetPixel(x * 24 + 12, y * 24 + 12);
          if (pixel == wall) value = "9, ";
          else if (pixel == road) value = "0, ";
          else value = "*, ";
          sb.Append(value);
        }
        sb.Append("1, 1, 1},");
        sb.Append(Environment.NewLine);
      }

      System.Diagnostics.Debug.WriteLine(sb);
    }
  }
}
